﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <class name="EnetaMvc.Core.Domain.Content.DynamicMenu, EnetaMvc.Core" table="dynamic_menu">
    
    <id name="Id" column="menu_id" type="long">
      <generator class="identity"/>
    </id>

    <property name="Name" column="menu_name" type="string" />
    <property name="Url" column="url" type="string" />
    <property name="IsVisible" column="visible" type="bool" />
    <property name="OrderPosition" column="order_position" type="int" />

    <many-to-one name="Parent" column="parent_id" class="EnetaMvc.Core.Domain.Content.DynamicMenu, EnetaMvc.Core" />
    <bag name="Children" table="dynamic_menu" inverse="true">
      <key column="parent_id" />
      <one-to-many class="EnetaMvc.Core.Domain.Content.DynamicMenu, EnetaMvc.Core" />
    </bag>
    
  </class>
</hibernate-mapping>